home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / defcon-minus.swf / scripts / DefineSprite_128_hud / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2011-10-17  |  1.4 KB  |  60 lines

  1. muteKeyDown = false;
  2. this.onEnterFrame = function()
  3. {
  4.    if(_name != "hudd")
  5.    {
  6.       if(_root._currentframe != 8 || _root.gameOver)
  7.       {
  8.          this._visible = false;
  9.       }
  10.       else if(!this.init)
  11.       {
  12.          this.init = true;
  13.          this._visible = true;
  14.       }
  15.       if(this.init)
  16.       {
  17.          if(Key.isDown(72) && !this.hKeyDown)
  18.          {
  19.             this.hKeyDown = true;
  20.             !this._visible ? (this._visible = true) : (this._visible = false);
  21.          }
  22.          else if(!Key.isDown(72))
  23.          {
  24.             this.hKeyDown = false;
  25.          }
  26.          this.swapDepths(_root.getNextHighestDepth());
  27.       }
  28.       if(Key.isDown(83))
  29.       {
  30.          stopAllSounds();
  31.          this.play();
  32.       }
  33.       if(Key.isDown(81))
  34.       {
  35.          if(_quality == "LOW")
  36.          {
  37.             _quality = "MEDIUM";
  38.          }
  39.          else if(_quality == "MEDIUM")
  40.          {
  41.             _quality = "HIGH";
  42.          }
  43.          else if(_quality == "HIGH")
  44.          {
  45.             _quality = "LOW";
  46.          }
  47.       }
  48.       if(Key.isDown(77) && !muteKeyDown)
  49.       {
  50.          muteKeyDown = true;
  51.          _root.vol != 100 ? (_root.vol = 100) : (_root.vol = 0);
  52.          _root.globalSound.setVolume(_root.vol);
  53.       }
  54.       if(!Key.isDown(77) && muteKeyDown)
  55.       {
  56.          muteKeyDown = false;
  57.       }
  58.    }
  59. };
  60.